<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:panel id="panelFiltro_RelAnual" header="#{bundle.filtroPesquisa}" >
            <h:panelGrid columns="2" border="0" >


                <h:outputLabel value="#{bundle.CreateControleDocumentoLabel_incluirCgh}" for="cgh_RelAnual" />              
                <p:selectOneMenu id="cgh_RelAnual" value="#{controleDocumentoController.incluiCgh}" >                                                                              
                    <f:selectItem itemLabel="#{bundle.MsgDialog_sim}" itemValue="#{true}" />
                    <f:selectItem itemLabel="#{bundle.MsgDialog_nao}" itemValue="#{false}"/>
                    <p:ajax update="orgaoUsina_RelAnual, :formList:tabViewDocs:tbl_RelAnual" listener="#{controleDocumentoController.carregaCGHsListaGeral}"/>
                </p:selectOneMenu> 

                <p:outputLabel value="#{bundle.EditControleDocumentoLabel_orgaoUsina}" for="orgaoUsina_RelAnual" />
                <p:selectOneMenu id="orgaoUsina_RelAnual" value="#{controleDocumentoController.orgao}"  filter="true" filterMatchMode="contains" > 
                    <f:selectItems value="#{orgaoController.itemsAvailableSelectOne}"/>
                    <p:ajax update="tcmUsiId_RelAnual,:formList:tabViewDocs:tbl_RelAnual" listener="#{controleDocumentoController.carregaUsinaFiltro}"/>
                </p:selectOneMenu>

                <p:outputLabel value="#{bundle.CreateControleDocumentoLabel_tcmUsiId}" for="tcmUsiId_RelAnual"/>
                <p:selectOneMenu  id="tcmUsiId_RelAnual" value="#{controleDocumentoController.selected.tcmUsiId}" filter="true" filterMatchMode="contains"  >
                    <f:selectItems value="#{controleDocumentoController.itemsAvailableSelectOneUsinasByOrgaoFiltro}"/>
                    <p:ajax update="@form"  listener="#{controleDocumentoController.carregaCGHsListaGeral}" />
                </p:selectOneMenu>

            </h:panelGrid>
            <br/> 
        </p:panel>
        <br/>

        <h:panelGroup>

            <p:dataTable id="tbl_RelAnual" value="#{controleDocumentoController.lista}" var="item"  paginator="true" rows="#{bundle.rows}" pageLinks="5" widgetVar="listaControleDocumentoTable"
                         currentPageReportTemplate="#{bundle.currentPageReportTemplateControleDocumento}"  paginatorTemplate="#{bundle.paginatorTemplate}"
                         rowsPerPageTemplate="#{bundle.rowsPerPageTemplate}"  paginatorPosition="#{bundle.paginatorPosition}" emptyMessage="#{bundle.ListControleDocumentoEmpty}" 
                         rowKey="#{item.tcmId}" selection="#{controleDocumentoController.selectedControleDocumento}" selectionMode="single">

                <f:facet id="global" name="header">
                    <p:outputPanel id="test" >
                        <h:outputText value="#{bundle.searchAllFields}" />
                        <p:inputText id="globalFilter" onkeyup="listaControleDocumentoTable.filter()" style="width: 200px;" >
                            <p:focus for="globalFilter" />
                        </p:inputText>
                    </p:outputPanel>
                </f:facet>

                <p:column exportable="true" styleClass="firstColumn" style="display: none;" filterBy="#{item.tcmId}" sortBy="#{item.tcmId}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmId}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmId}"/>
                </p:column>

                <p:column styleClass="columnProcesso" filterBy="#{item.tcmUsiId.usiProcesso}" sortBy="#{item.tcmUsiId.usiProcesso}" sortFunction="#{controleDocumentoController.sortByUsiProcesso}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_usiProcesso}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmUsiId.usiProcesso}" converter="inputConverter"/>
                </p:column>

                <p:column filterBy="#{item.tcmUsiId.orgaoUsina}" sortBy="#{item.tcmUsiId.orgaoUsina}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_orgaoUsina}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmUsiId.orgaoUsina}"/>
                </p:column>

                <p:column styleClass="columnTipo" filterBy="#{item.tcmUsiId.usiTpuId.tpuNm}" sortBy="#{item.tcmUsiId.usiTpuId.tpuNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tpuNm}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmUsiId.usiTpuId.tpuNm}"/>                        
                </p:column>

                <p:column filterBy="#{item.tcmUsiId.usiNm}" sortBy="#{item.tcmUsiId.usiNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmUsiId}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmUsiId.usiNm}"/>                        
                </p:column>

                <p:column styleClass="columnNumber" filterBy="#{item.tcmProton}" sortBy="#{item.tcmProton}" sortFunction="#{controleDocumentoController.sortByTcmProton}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmProton}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmProton}" converter="protonInputConverter"/>

                </p:column>                        

                <p:column styleClass="firstColumn" filterBy="#{item.tcmTxNumero}" sortBy="#{item.tcmTxNumero}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTxNumero}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmTxNumero}" converter="protonInputConverter"/>
                </p:column>


                <p:column exportable="true" style="display:none;" filterBy="#{item.tcmTdcId.tdcNm}" sortBy="#{item.tcmTdcId.tdcNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTdcId}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmTdcId.tdcNm}"/>
                </p:column>

                <p:column exportable="true" style="display:none;" filterBy="#{item.tcmTxObservacao}" sortBy="#{item.tcmTxObservacao}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTxObservacao}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmTxObservacao}"/>
                </p:column>


                <p:column styleClass="columnNumber" filterBy="#{item.tcmDtCadastro}" sortBy="#{item.tcmDtCadastro}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmDtCadastro}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmDtCadastro}">
                        <f:convertDateTime pattern="#{bundle.patternApp}" />
                    </h:outputText>
                </p:column>                      

                <p:column styleClass="columnTipo" filterBy="#{item.tcmRspId.rspAreId.areNm}" sortBy="#{item.tcmRspId.rspAreId.areNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListResponsavelTitle_rspAreId}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmRspId.rspAreId.areNm}"/>
                </p:column>

                <p:column styleClass="columnStatus" filterBy="#{item.tcmSdcId.sdcNm}" sortBy="#{item.tcmSdcId.sdcNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmSdcId}"/>
                    </f:facet>
                    <h:outputText value="#{item.tcmSdcId.sdcNm}" />
                </p:column>
                <!---->
                <p:column exportable="true" style="display:none;">
                    <f:facet name="header">
                        <h:outputText value=""/>
                    </f:facet>
                    <h:outputText value=""/>
                </p:column>

                <!--NOTA TECNICA-->

                <p:column exportable="true" style="display:none;" filterBy="#{item.notaTecnica.tcmTdcId.tdcNm}" sortBy="#{item.notaTecnica.tcmTdcId.tdcNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTdcId}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmTdcId.tdcNm}" rendered="#{item.notaTecnica.tcmTxNumero != null}"/>
                </p:column>

                <p:column exportable="true" style="display:none;" filterBy="#{item.notaTecnica.tcmTdcId.tdcNm}" sortBy="#{item.notaTecnica.tcmTxNumero}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTxNumero}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmTxNumero}" converter="protonInputConverter"/>
                </p:column>
                <p:column exportable="true" style="display:none;" filterBy="#{item.notaTecnica.tcmProton}" sortBy="#{item.notaTecnica.tcmProton}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmProton}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmProton}" converter="protonInputConverter" />
                </p:column>
                <p:column exportable="true" style="display:none;" filterBy="#{item.notaTecnica.tcmDtCadastro}" sortBy="#{item.notaTecnica.tcmDtCadastro}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmDtCadastro}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmDtCadastro}">
                        <f:convertDateTime pattern="#{bundle.patternApp}" />
                    </h:outputText>
                </p:column>
                <p:column exportable="true" style="display:none;" filterBy="#{item.notaTecnica.tcmDtExpedicao}" sortBy="#{item.notaTecnica.tcmDtExpedicao}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmDtExpedicao}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmDtExpedicao}">
                        <f:convertDateTime pattern="#{bundle.patternApp}" />
                    </h:outputText>
                </p:column>

                <p:column exportable="true" style="display:none;" filterBy="#{item.notaTecnica.tcmSdcId.sdcNm}" sortBy="#{item.notaTecnica.tcmSdcId.sdcNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmSdcId}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmSdcId.sdcNm}" rendered="#{item.notaTecnica.tcmTxNumero != null}"/>
                </p:column>


                <p:column exportable="true" style="display:none;" filterBy="#{item.notaTecnica.tcmTxObservacao}" sortBy="#{item.notaTecnica.tcmTxObservacao}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText value="#{bundle.ListControleDocumentoTitle_tcmTxObservacao}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmTxObservacao}"/>
                </p:column>

                <!--OFICIO -->

                <p:column exportable="true" style="display:none;" filterBy="#{item.oficio.tcmTdcId.tdcNm}" sortBy="#{item.oficio.tcmTdcId.tdcNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTdcId}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmTdcId.tdcNm}" rendered="#{item.oficio.tcmTxNumero != null or item.oficio.tcmProton != null}"/>
                </p:column>
                <p:column exportable="true" style="display:none;" filterBy="#{item.oficio.tcmProton}" sortBy="#{item.oficio.tcmProton}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmProton}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmProton}"  converter="protonInputConverter"/>

                </p:column>

                <p:column exportable="true" style="display:none;" filterBy="#{item.oficio.tcmTxNumero}" sortBy="#{item.oficio.tcmTxNumero}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTxNumero}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmTxNumero}" converter="protonInputConverter" />
                </p:column>
                <p:column exportable="true" style="display:none;" filterBy="#{item.oficio.tcmDtCadastro}" sortBy="#{item.oficio.tcmDtCadastro}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmDtCadastro}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmDtCadastro}">
                        <f:convertDateTime pattern="#{bundle.patternApp}" />
                    </h:outputText>
                </p:column>
                <p:column exportable="true" style="display:none;" filterBy="#{item.oficio.tcmDtExpedicao}" sortBy="#{item.oficio.tcmDtExpedicao}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmDtExpedicao}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmDtExpedicao}">
                        <f:convertDateTime pattern="#{bundle.patternApp}" />
                    </h:outputText>
                </p:column>

                <p:column exportable="true" style="display:none;" filterBy="#{item.oficio.tcmSdcId.sdcNm}" sortBy="#{item.oficio.tcmSdcId.sdcNm}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmSdcId}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmSdcId.sdcNm}" rendered="#{item.oficio.tcmTxNumero != null or item.oficio.tcmProton != null}"/>
                </p:column>                       

                <p:column exportable="true" style="display:none;" filterBy="#{item.oficio.tcmTxObservacao}" sortBy="#{item.oficio.tcmTxObservacao}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTxObservacao}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmTxObservacao}"/>
                </p:column>

                <p:column styleClass="columnNotaOficio" exportable="false" filterBy="#{item.notaTecnica.tcmTxNumero}" sortFunction="#{controleDocumentoController.sortByNumeroNotaOficio}" sortBy="#{item.notaTecnica.tcmTxNumero}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTxNota}"/>
                    </f:facet>
                    <h:outputText value="#{item.notaTecnica.tcmTxNumero}" converter="protonInputConverter"/>
                </p:column>                       

                <p:column styleClass="columnNotaOficio" exportable="false" filterBy="#{item.oficio.tcmTxNumero}" sortFunction="#{controleDocumentoController.sortByNumeroNotaOficio}" sortBy="#{item.oficio.tcmTxNumero}" filterMatchMode="contains">
                    <f:facet name="header">
                        <h:outputText styleClass="cabecalhoNegrito" value="#{bundle.ListControleDocumentoTitle_tcmTxOficio}"/>
                    </f:facet>
                    <h:outputText value="#{item.oficio.tcmTxNumero}" converter="protonInputConverter"/>
                </p:column>

                <p:column style="width:3%" exportable="false">
                    <div class="cabecalho">                                     
                        <div class="titulo">
                            <p:commandLink ajax="false"  action="#{controleDocumentoController.prepareEdit}" rendered="#{!autenticadorController.loginVisualizador}" title="#{bundle.ListAreaEditLink}" styleClass="ui-icon ui-icon-pencil" >
                                <f:setPropertyActionListener value="#{item}" 
                                                             target="#{controleDocumentoController.selectedControleDocumento}" />
                            </p:commandLink>
                        </div>
                    </div>                     
                </p:column>

                <f:facet name="footer">                            
                    <p:commandButton id="createCommand_RelAnual" rendered="#{!autenticadorController.loginVisualizador}" ajax="false" icon="ui-icon-document"  action="#{controleDocumentoController.prepareCreate}" value="#{bundle.ListControleDocumentoCreateLink}"/>
                    <p:commandButton id="viewCommand_RelAnual"  value="#{bundle.MsgVisualizar}" icon="ui-icon-search"  update=":formList:tabViewDocs:displayView_RelAnual" oncomplete="controleDocumentoDialogView_RelAnual.show()" onerror="controleDocumentoDialogView_RelAnual.hide()" actionListener="#{controleDocumentoController.prepareView}" />
                    <p:commandButton id="editCommand_RelAnual" ajax="false" action="#{controleDocumentoController.prepareEdit}"  value="#{bundle.ListControleDocumentoEditLink}" icon="ui-icon-pencil" rendered="#{!autenticadorController.loginVisualizador}"/>
                    <p:commandButton id="deleteCommand_RelAnual" ajax="false" rendered="#{autenticadorController.loginAdmin}" onclick="confirmationDestroy_RelAnual.show();" value="#{bundle.ListControleDocumentoDestroyLink}" type="button" icon="ui-icon-trash" />

                    <p:commandButton id="excelExportAll_RelAnual"  ajax="false" value="#{bundle.excelExportAll}" icon="ui-icon-script">
                        <p:dataExporter type="xls" target="tbl_RelAnual" fileName="#{bundle.excelExportAllFileName_ControleDocumento}" postProcessor="#{controleDocumentoController.postProcessorXLS}"/>
                    </p:commandButton>
                    <p:commandButton id="excelExportPagAtual_RelAnual" ajax="false" value="#{bundle.excelExportPagAtual}" icon="ui-icon-calculator">
                        <p:dataExporter type="xls" target="tbl_RelAnual" fileName="#{bundle.excelExportPagAtualFileName_ControleDocumento}" pageOnly="true" postProcessor="#{controleDocumentoController.postProcessorXLS}"/>
                    </p:commandButton>
                </f:facet>

            </p:dataTable>

            <p:confirmDialog id="confirmDestroy_RelAnual" message="#{bundle.MsgConfirmDestroy_message}" header="#{bundle.MsgConfirmDestroy_header}" severity="alert" widgetVar="confirmationDestroy_RelAnual">
                <p:commandButton id="confirm_RelAnual" ajax="false" value="#{bundle.MsgDialog_confirmar}"  oncomplete="confirmationDestroy_RelAnual.hide(); #{controleDocumentoController.prepareList}" action="#{controleDocumentoController.destroyDocsPrincipais}"  update="tbl"/>
                <p:commandButton id="decline_RelAnual"  value="#{bundle.MsgDialog_cancelar}" update="messages" onclick="confirmationDestroy_RelAnual.hide();" type="button"/>

            </p:confirmDialog>

            <p:dialog id="dialogView_RelAnual" position="center"  modal="true" header="#{bundle.ControleDocumentoDialogView_header}" widgetVar="controleDocumentoDialogView_RelAnual" resizable="false"
                      width="930" >

                <h:panelGrid id="displayView_RelAnual" columns="2" cellpadding="4">

                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmId}"/>
                    <h:outputText value="#{controleDocumentoController.selected.tcmId}" title="#{bundle.ViewControleDocumentoTitle_tcmId}"/>                           

                    <h:outputLabel value="#{bundle.ViewUsinaLabel_usiProcesso}"/>

                    <h:outputLink styleClass="formataLink"  target="new"  id="link_RelAnual" value="#{controleDocumentoController.pesquisaProcesso()}"  >
                        <h:outputText value="#{controleDocumentoController.selected.tcmUsiId.usiProcesso}" converter="inputConverter" title="#{bundle.ListControleDocumentoTitle_usiProcesso}"/> 
                    </h:outputLink>

                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmProton}"/>

                    <h:outputLink styleClass="formataLink"  target="new" id="linkProton_RelAnual" value="#{controleDocumentoController.pesquisaProton()}">
                        <h:outputText value="#{controleDocumentoController.selected.tcmProton}" converter="protonInputConverter" title="#{bundle.ViewControleDocumentoTitle_tcmProton}"/>
                    </h:outputLink>

                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmTxNumero}"/>
                    <h:outputText value="#{controleDocumentoController.selected.tcmTxNumero}" converter="protonInputConverter" title="#{bundle.ViewControleDocumentoTitle_tcmTxNumero}"/>                            

                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmDtCadastro}"/>                            
                    <h:outputText value="#{controleDocumentoController.selected.tcmDtCadastro}" title="#{bundle.ViewControleDocumentoTitle_tcmDtCadastro}">
                        <f:convertDateTime pattern="#{bundle.patternApp}" />
                    </h:outputText>
                    <ui:remove>
                        <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmDtAtualizacao}"/>
                        <h:outputText value="#{controleDocumentoController.selected.tcmDtExpedicao}" title="#{bundle.ViewControleDocumentoTitle_tcmDtAtualizacao}">
                            <f:convertDateTime pattern="#{bundle.patternApp}" />
                        </h:outputText>
                    </ui:remove>   

                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_orgaoUsina}"/>
                    <h:outputText value="#{controleDocumentoController.selected.tcmUsiId.orgaoUsina}" title="#{bundle.ViewControleDocumentoTitle_orgaoUsina}"/>

                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmUsiId}"/>
                    <h:outputText value="#{controleDocumentoController.selected.tcmUsiId.usiNm}" title="#{bundle.ViewControleDocumentoTitle_tcmUsiId}"/>
                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmTdcId}"/>
                    <h:outputText value="#{controleDocumentoController.selected.tcmTdcId.tdcNm}" title="#{bundle.ViewControleDocumentoTitle_tcmTdcId}"/>

                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmSdcId}"/>
                    <h:outputText value="#{controleDocumentoController.selected.tcmSdcId.sdcNm}" title="#{bundle.ViewControleDocumentoTitle_tcmSdcId}"/>

                    <ui:remove>
                        <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmIcObrigatorio}"/>
                        <h:outputText value="#{controleDocumentoController.selected.obrigatorio}" title="#{bundle.ViewControleDocumentoTitle_tcmIcObrigatorio}"/>
                    </ui:remove>
                    <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmTxObservacao}"/>
                    <h:outputText value="#{controleDocumentoController.selected.tcmTxObservacao}" converter="tamanhoStringConverter" title="#{bundle.ViewControleDocumentoTitle_tcmTxObservacao}"/>

                    <h:outputLabel id="labelNotaTecnica_RelAnual" value="#{bundle.HeaderPanelControleDocumento_notaTecnica}" rendered="#{controleDocumentoController.exibePanel}" />
                    <p:panel id="panelNotaTecnica_RelAnual" style="width: 720px;" header="#{bundle.HeaderPanelControleDocumento_notaTecnica}" rendered="#{controleDocumentoController.exibePanel}" >
                        <h:panelGrid columns="2" >

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmTxNumero}"/>

                            <h:outputText value="#{controleDocumentoController.notaTecnica.tcmTxNumero}" converter="protonInputConverter" title="#{bundle.ViewControleDocumentoTitle_tcmTxNumero}"/>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmDtCadastro}"/>
                            <h:outputText value="#{controleDocumentoController.notaTecnica.tcmDtCadastro}" title="#{bundle.ViewControleDocumentoTitle_tcmDtCadastro}">
                                <f:convertDateTime pattern="#{bundle.patternApp}" />
                            </h:outputText>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmProton}"/>
                            <h:outputLink styleClass="formataLink" target="new" id="linkProtonNota_RelAnual" value="#{controleDocumentoController.pesquisaProtonNota()}" >
                                <h:outputText value="#{controleDocumentoController.notaTecnica.tcmProton}" converter="protonInputConverter" title="#{bundle.ViewControleDocumentoTitle_tcmProton}"/>
                            </h:outputLink>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmSdcId}"/>
                            <h:outputText value="#{controleDocumentoController.notaTecnica.tcmSdcId.sdcNm}" title="#{bundle.ViewControleDocumentoTitle_tcmSdcId}"/>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmTxConclusao}"/>
                            <h:outputText value="#{controleDocumentoController.notaTecnica.tcmTxObservacao}" converter="tamanhoStringConverter" title="#{bundle.ViewControleDocumentoTitle_tcmTxConclusao}"/>
                        </h:panelGrid>

                    </p:panel>

                    <h:outputLabel id="labelOficio_RelAnual" value="#{bundle.HeaderPanelControleDocumento_oficio}" rendered="#{controleDocumentoController.exibePanel}"/>
                    <p:panel id="panelOficio_RelAnual" style="width: 720px;" header="#{bundle.HeaderPanelControleDocumento_oficio}" rendered="#{controleDocumentoController.exibePanel}">      
                        <h:panelGrid columns="2" >

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmTxNumero}"/>
                            <h:outputText value="#{controleDocumentoController.oficio.tcmTxNumero}" converter="protonInputConverter" title="#{bundle.ViewControleDocumentoTitle_tcmTxNumero}"/>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmDtCadastro}"/>
                            <h:outputText value="#{controleDocumentoController.oficio.tcmDtCadastro}" title="#{bundle.ViewControleDocumentoTitle_tcmDtCadastro}">
                                <f:convertDateTime pattern="#{bundle.patternApp}" />
                            </h:outputText>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmDtExpedicao}"/>
                            <h:outputText value="#{controleDocumentoController.oficio.tcmDtExpedicao}" title="#{bundle.ViewControleDocumentoTitle_tcmDtExpedicao}">
                                <f:convertDateTime pattern="#{bundle.patternApp}" />
                            </h:outputText>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmProton}"/>                                                 
                            <h:outputLink styleClass="formataLink" target="new" id="linkProtonOficio_RelAnual" value="#{controleDocumentoController.pesquisaProtonOficio()}" >
                                <h:outputText value="#{controleDocumentoController.oficio.tcmProton}" converter="protonInputConverter" title="#{bundle.ViewControleDocumentoTitle_tcmProton}"/>
                            </h:outputLink>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmSdcId}"/>
                            <h:outputText value="#{controleDocumentoController.oficio.tcmSdcId.sdcNm}" title="#{bundle.ViewControleDocumentoTitle_tcmSdcId}"/>

                            <h:outputLabel value="#{bundle.ViewControleDocumentoLabel_tcmTxObservacao}"/>
                            <h:outputText value="#{controleDocumentoController.oficio.tcmTxObservacao}" converter="tamanhoStringConverter" title="#{bundle.ViewControleDocumentoTitle_tcmTxObservacao}"/>
                        </h:panelGrid>

                    </p:panel>

                    <h:outputLabel value="#{bundle.createBy}" for="nomeCriador_RelAnual" rendered="#{not empty controleDocumentoController.selected.historicoCriacao.nomeUsuario}"/>
                    <h:outputText id="nomeCriador_RelAnual" value="#{controleDocumentoController.selected.historicoCriacao.nomeUsuario}" rendered="#{not empty controleDocumentoController.selected.historicoCriacao.nomeUsuario}"/>
                    <h:outputLabel value="#{bundle.createDate}" for="dataCriacao_RelAnual" rendered="#{not empty controleDocumentoController.selected.historicoCriacao.dataHora}"/>
                    <h:outputText id="dataCriacao_RelAnual" value="#{controleDocumentoController.selected.historicoCriacao.dataHora}" rendered="#{not empty controleDocumentoController.selected.historicoCriacao.dataHora}"/>     
                    <h:outputLabel value="#{bundle.updateBy}" for="nomeAlterador_RelAnual" rendered="#{not empty controleDocumentoController.selected.historicoAlteracao.nomeUsuario}"/>
                    <h:outputText id="nomeAlterador_RelAnual" value="#{controleDocumentoController.selected.historicoAlteracao.nomeUsuario}" rendered="#{not empty controleDocumentoController.selected.historicoAlteracao.nomeUsuario}"/>
                    <h:outputLabel value="#{bundle.updateDate}" for="dataAlteracao_RelAnual" rendered="#{not empty controleDocumentoController.selected.historicoAlteracao.dataHora}"/>
                    <h:outputText id="dataAlteracao_RelAnual" value="#{controleDocumentoController.selected.historicoAlteracao.dataHora}" rendered="#{not empty controleDocumentoController.selected.historicoAlteracao.dataHora}" /> 

                </h:panelGrid>
            </p:dialog>
        </h:panelGroup>
    </ui:composition>
</html>